package Class;

import java.util.Scanner;

import org.junit.Test;

import day.Add;
import day.Cal;
import day.Div;

public class Text {

//	@Test
//	public void test() {
//		Student stu = new Student(0, null, 0, null);
//		stu.id = 7;
//		stu.name = "张三";
//		stu.year = 22;
//		stu.className = "java190703";
//		stu.study();
//		String name = stu.name;
//		System.out.println(name);
//	}
//
//	@Test
//	public void test23() {
//		Scanner scanner = new Scanner(System.in);
//		System.out.println("请输入学生数量：");
//		int count = scanner.nextInt();
//		Student[] array = new Student[count]; //int[] array = new int[count];student是类，属于引用数据类型
//		for(int i = 0; i < array.length; i++) {
//			Student stu = new Student();
//			System.out.println("请输入学生id");
//			int id = scanner.nextInt();
//			stu.id = id;
//			System.out.println("请输入学生的姓名：");
//			String name = scanner.next();
//			stu.name = name;
//			array[i] = stu;
//		}
//		for(int i = 0; i < array.length; i++) {
//			Student stu = array[i];
//			System.out.println(stu.id);
//			System.out.println(stu.name);
//			System.out.println(stu.year);
//			System.out.println(stu.className);
//		}
//	}
//
//	@Test
//	public void test9() {
//		Scanner scanner = new Scanner(System.in);
//		System.out.println("请输入学生数量：");
//		int count = scanner.nextInt();
//		Student[] array = new Student[count];
//		for(int i = 0; i < array.length; i++) {
//			Student stud = new Student();
//			System.out.println("请输入学号：");
//			int id = scanner.nextInt();
//			stud.id = id;
//			System.out.println("请输入姓名：");
//			String name = scanner.next();
//			stud.name = name;
//			System.out.println("请输入年龄：");
//			int year = scanner.nextInt();
//			stud.year = year;
//			System.out.println("请输入班级：");
//			String className = scanner.next();
//			stud.className = className;
//			array[i] = stud;
//		} 
//		for(int i = 0; i < array.length; i++) {
//			Student stud = array[i];
//			System.out.println(stud.id + "," + stud.name + "," + stud.className + "," + stud.year);
//		}
//	}
	@Test
	public void test211() {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入教师数量：");
		int count = scanner.nextInt();
		Teacher[] array = new Teacher[count];
		for(int i = 0; i < array.length; i++) {
			Teacher teach = new Teacher();
			System.out.println("请输入教师编号：");
			int id = scanner.nextInt();
			teach.id = id;
			System.out.println("请输入姓名：");
			String name = scanner.next();
			teach.name = name;
			array[i] = teach;
		}
		for(int i = 0; i < array.length; i++) {
			Teacher teach = array[i];
			System.out.println(teach.id);
			System.out.println(teach.name);
			System.out.println(teach.age);
			System.out.println(teach.className);
		}
	}
	
	@Test
	public void test2() {
		Teacher teach = new Teacher();
		teach.name = "李四";
		teach.className = "html";
		teach.teach();
	}
	
	@Test
	public void expl() {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入第一个数：");
		int num1 = scanner.nextInt();
		System.out.println("请输入第二个数：");
		int num2 = scanner.nextInt();
		Number number = new Number(num1,num2);
		System.out.print("两数相加得：");
		//Add add1 = new Add(num1,num2);
		number.add();
		System.out.print("两数相减得：");
		number.sub();
		System.out.print("两数相乘得：");
		number.multi();
		System.out.print("两数相除得：");
		number.div();
	}
	
	@Test
	public void rectan() {
		Rectangule rec1 = new Rectangule();//无参
		rec1.Circle();
		rec1.Area();
		
		Scanner scanner = new Scanner(System.in);//一个参数
		System.out.println("请输入长或宽：");
		int length = scanner.nextInt();
		Rectangule rec2 = new Rectangule(length);
		rec2.Circle();
		rec2.Area();
		
		Scanner scanner1 = new Scanner(System.in);//三个参数
		System.out.println("请输入长：");
		int length3 = scanner1.nextInt();
		System.out.println("请输入宽：");
		int width3 = scanner1.nextInt();
		Rectangule rec3 = new Rectangule(length3,width3);
		rec3.Circle();
		rec3.Area();
	}

	@Test
	public void move() {
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入第一个坐标值：");
		int x = scanner.nextInt();
		System.out.println("请输入第二个坐标值：");
		int y = scanner.nextInt();
		System.out.println("请输入第一个增量值：");
		int dx = scanner.nextInt();
		System.out.println("请输入第二个增量值：");
		int dy = scanner.nextInt();
		Point point = new Point(x,y);
		point.movePoint(dx, dy);
		
	}
	
	@Test
	public void Cal() {
//		Add add = new Add();
//		add.setNum1(3);
//		add.setNum2(3);
//		int result = add.getResult();
//		System.out.println(result);
		
		Add add2 = new Add(3,5);
		System.out.println(add2.getResult());
	}
	
	@Test
	public void duo() {//多态建立test测试的时候必须在同一包下
		//Cal cal = new Cal(3,5);
		Cal cal = new Add(3,5);
		int result1 = cal.getResult();
		System.out.println(result1);
		Cal cal2 = new Div(6,2);
		int result2 = cal2.getResult();
		System.out.println(result2);
	}
}
